function argTest(arg1,arg2,arg3,arg4) {
	alert(arguments.caller + ' ' + this.a + ' ' + arg1 + ' ' + arg2 + ' ' + arg3 + ' ' + arg4);
	return 5;
}

obj1 = "{\"foo\":\"test\",\"bar\":3,\"obj\":{\"foo\":\"test\",\"bar\":3,\"obj\":{\"foo\":\"test\",\"bar\":3,\"obj\":\"$ref:$\"}}}";
obj2 = "{\"foo\":\"test\",\"bar\":3,\"obj\":{\"foo\":\"test\",\"bar\":3,\"obj\":{\"foo\":\"test\",\"bar\":3,\"obj\":{\"$ref\":\"$\"}}}}";
parse = function(str) {
	if(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(str. // from json.js from json.org
					                    replace(/\\./g, '@').
					                    replace(/"[^"\\\n\r]*"/g, ''))) 
		return intake2(eval('(' + str + ')'));
}
function reference(ref){
}
var refRegex = /^\$ref:/;
intake1 = function(data) {
	var val;
	for (var i in data) {
		if (typeof (val=data[i]) =='object') 
			intake1(val);
		else if (typeof val == 'string' && refRegex.test(val)) 
			reference(val);
	}
}
intake2 = function(data) {
	var val;
	for (var i in data) {
		if (typeof (val=data[i]) =='object') {
			if (val.$ref)
				reference(val.$ref);
			intake2(val);
		}
	}
}
function runtest () {
	var time = new Date().getTime();
	for (var i = 0; i < 10000; i++)
		parse(obj2);
	alert(new Date().getTime() - time);
}
obj =